package com.boc.langxiang.ui.adapter.adm;

import android.content.Context;
import android.widget.ImageView;

import com.boc.langxiang.R;
import com.boc.langxiang.entity.response.AritstMessageEntity;
import com.boc.langxiang.entity.response.ArticleEntity;
import com.boc.langxiang.manager.PicassoImageLoader;
import com.boc.langxiang.util.StringUtil;
import com.boc.langxiang.util.TimeUtil;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * CreateTime: 2016-06-17上午9:23
 * Author: wjkjinke00@126.com
 * Description:
 */
public class ArtistMessageAdapter extends BaseQuickAdapter<AritstMessageEntity> {

    public ArtistMessageAdapter(Context context, List<AritstMessageEntity> data) {
        super( R.layout.item_artist_message, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, AritstMessageEntity item) {
        helper.setText(R.id.name, StringUtil.getValue(item.getNickname()))
                .setText(R.id.content, StringUtil.getValue(item.getContent()))
                .setText(R.id.time, TimeUtil.formatTime(item.getTimeline(), TimeUtil.TYPE_Y_M_D_2));

        PicassoImageLoader.getInstance().displayUrlImage(mContext, item.getAccount_photo()
                , (ImageView) helper.getView(R.id.head));
    }

}
